﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DesignPattern.创建型模式.SingletonPattern._01
{
    /// <summary>
    /// 但没有考虑线程安全，在多线程时可能会出问题
    /// </summary>
    public class Singleton01
    {
        private static Singleton01 _instance = null;
        private Singleton01() { }
        public static Singleton01 CreateInstance()
        {
            if (_instance == null)
            {
                _instance = new Singleton01();
            }
            return _instance;
        }
    }
}
